package com.example.teacher.controller;

import com.example.commonutils.ResultData;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/backstage/user")
public class LoginController {
    @PostMapping(value = "login",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultData login(){
        return ResultData.ok().data("token","admin");
    }

    @GetMapping(value = "info",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultData info(){
        return ResultData.ok().data("roles","admin").data("name","admin")
                .data("avatar","https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201607%2F24%2F20160724154031_sZR8M.thumb.400_0.gif&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1655882832&t=c63ab2ab8a32708fd1d0b1f374c74a2c");
    }
}
